<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#exams-sortable").tablesorter({widgets: ['zebra']}); 
    } 
); 
</script>		
<div id="sortTables">		
		<table id="exams-sortable" class="tablesorter">
		<thead>
			<tr>
				<th scope="col">Datum</th>
				<th scope="col">Tentamen</th>
				<th scope="col">Förhandsanmälan</th>
				<th scope="col">Status</th>
				<th scope="col">Kursen <br />avklarad</th>
				<th scope="col">Anmälan</th>
				<th scope="col">Stryk</th>
			</tr>
		</thead>
		<tbody>
<?php foreach ($exams as $exam) { ?>
<?php if (strlen($exam['exam_name']) > 0) { ?>
			<tr>
				<td><?php echo $exam['exam_date']; ?></td>
				<td><?php echo $exam['exam_name']; ?></td>
				<td><?php echo $exam['exam_active']; ?></td>
				<td><?php echo $exam['exam_status']; ?></td>
				<td><?php if ($exam['exam_completed'] == "Nej") echo '<img alt="Nej" src="css/var_plan/icons/stop.png">'; 
						  else echo '<img alt="Nej" src="css/var_plan/icons/stop.png">';?></td>
				<td><?php
					if ($exam['exam_enroll']) {
						echo "<a href=\"?action=enrollExam&row={$exam['exam_row']}\">[Anmäl]</a>";
					}
					else if ($exam['exam_drop']) {
						echo "<a href=\"?action=dropExam&row={$exam['exam_row']}\">[Återta]</a>";
					}
				?></td>
				<td><a href="?action=removeExam&row=<?php echo $exam['exam_row']; ?>"><img alt="[Stryk]" src="css/var_plan/icons/cross.png"></a></td>
			</tr>
<?php } ?>
<?php } ?>
		</tbody>
		</table>
<div/>
